﻿using BusinessLayer;
using MvcOSGi.Shell.App_Start;
using System;
using System.Collections.Generic;
using System.Data.Linq;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MvcOSGi.Shell.Infra
{
    public abstract class BaseController : Controller
    {
        public BaseController()
        {
            Context = new VersionDBContext();
            CompanyContext = new CompanyDBContext();
            DataBag = new Dictionary<BusinessLayer.Enums.DataBagKey, IMultipleResults>();
        }

        public VersionDBContext Context { get; set; }
        public CompanyDBContext CompanyContext { get; set; }
        //public Version.Version VersionInfo { get; set; }
        //public Version.Page PageInfo { get; set; }
        public RequestInfo RequestInfo { get; set; }

        public Dictionary<BusinessLayer.Enums.DataBagKey, IMultipleResults> DataBag { get; set; }

        //protected override void OnException(ExceptionContext filterContext)
        //{
        //    if (filterContext.ExceptionHandled)
        //    {
        //        return;
        //    }
        //    filterContext.Result = new ViewResult
        //    {
        //        ViewName = "~/Views/Ecomm/Error.html"
        //    };
        //    filterContext.ExceptionHandled = true;
        //}
    }

}
